3.80 \(\int (g+h x) \sqrt{a+c x^2} (d+e x+f x^2) \, dx\)

Optimal. Leaf size=175 \[ -\frac{\left (a+c x^2\right )^{3/2} \left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (d h+e g)\right )\right )+3 c h x (3 f g-5 e h)\right )}{60 c^2 h}+\frac{a \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (-a e h-a f g+4 c d g)}{8 c^{3/2}}+\frac{x \sqrt{a+c x^2} (4 c d g-a (e h+f g))}{8 c}+\frac{f \left (a+c x^2\right )^{3/2} (g+h x)^2}{5 c h} \]

[Out]

((4*c*d*g - a*(f*g + e*h))*x*Sqrt[a + c*x^2])/(8*c) + (f*(g + h*x)^2*(a + c*x^2)^(3/2))/(5*c*h) - ((4*(2*a*f*h
^2 + c*(3*f*g^2 - 5*h*(e*g + d*h))) + 3*c*h*(3*f*g - 5*e*h)*x)*(a + c*x^2)^(3/2))/(60*c^2*h) + (a*(4*c*d*g - a
*f*g - a*e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(8*c^(3/2))

________________________________________________________________________________________

Rubi [A]  time = 0.268063, antiderivative size = 175, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {1654, 780, 195, 217, 206} \[ -\frac{\left (a+c x^2\right )^{3/2} \left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (d h+e g)\right )\right )+3 c h x (3 f g-5 e h)\right )}{60 c^2 h}+\frac{a \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (-a e h-a f g+4 c d g)}{8 c^{3/2}}+\frac{x \sqrt{a+c x^2} (4 c d g-a (e h+f g))}{8 c}+\frac{f \left (a+c x^2\right )^{3/2} (g+h x)^2}{5 c h} \]

Antiderivative was successfully verified.

[In]

Int[(g + h*x)*Sqrt[a + c*x^2]*(d + e*x + f*x^2),x]

[Out]

((4*c*d*g - a*(f*g + e*h))*x*Sqrt[a + c*x^2])/(8*c) + (f*(g + h*x)^2*(a + c*x^2)^(3/2))/(5*c*h) - ((4*(2*a*f*h
^2 + c*(3*f*g^2 - 5*h*(e*g + d*h))) + 3*c*h*(3*f*g - 5*e*h)*x)*(a + c*x^2)^(3/2))/(60*c^2*h) + (a*(4*c*d*g - a
*f*g - a*e*h)*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(8*c^(3/2))

Rule 1654

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + c*x^2)^(p + 1))/(c*e^(q - 1)*(m + q + 2*p + 1)), x]
 + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rule 780

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(((e*f + d*g)*(2*p
 + 3) + 2*e*g*(p + 1)*x)*(a + c*x^2)^(p + 1))/(2*c*(p + 1)*(2*p + 3)), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 195

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(x*(a + b*x^n)^p)/(n*p + 1), x] + Dist[(a*n*p)/(n*p + 1),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int (g+h x) \sqrt{a+c x^2} \left (d+e x+f x^2\right ) \, dx &=\frac{f (g+h x)^2 \left (a+c x^2\right )^{3/2}}{5 c h}+\frac{\int (g+h x) \left ((5 c d-2 a f) h^2-c h (3 f g-5 e h) x\right ) \sqrt{a+c x^2} \, dx}{5 c h^2}\\ &=\frac{f (g+h x)^2 \left (a+c x^2\right )^{3/2}}{5 c h}-\frac{\left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (e g+d h)\right )\right )+3 c h (3 f g-5 e h) x\right ) \left (a+c x^2\right )^{3/2}}{60 c^2 h}+\frac{(4 c d g-a f g-a e h) \int \sqrt{a+c x^2} \, dx}{4 c}\\ &=\frac{(4 c d g-a (f g+e h)) x \sqrt{a+c x^2}}{8 c}+\frac{f (g+h x)^2 \left (a+c x^2\right )^{3/2}}{5 c h}-\frac{\left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (e g+d h)\right )\right )+3 c h (3 f g-5 e h) x\right ) \left (a+c x^2\right )^{3/2}}{60 c^2 h}+\frac{(a (4 c d g-a f g-a e h)) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{8 c}\\ &=\frac{(4 c d g-a (f g+e h)) x \sqrt{a+c x^2}}{8 c}+\frac{f (g+h x)^2 \left (a+c x^2\right )^{3/2}}{5 c h}-\frac{\left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (e g+d h)\right )\right )+3 c h (3 f g-5 e h) x\right ) \left (a+c x^2\right )^{3/2}}{60 c^2 h}+\frac{(a (4 c d g-a f g-a e h)) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{8 c}\\ &=\frac{(4 c d g-a (f g+e h)) x \sqrt{a+c x^2}}{8 c}+\frac{f (g+h x)^2 \left (a+c x^2\right )^{3/2}}{5 c h}-\frac{\left (4 \left (2 a f h^2+c \left (3 f g^2-5 h (e g+d h)\right )\right )+3 c h (3 f g-5 e h) x\right ) \left (a+c x^2\right )^{3/2}}{60 c^2 h}+\frac{a (4 c d g-a f g-a e h) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{8 c^{3/2}}\\ \end{align*}

Mathematica [A]  time = 0.438547, size = 153, normalized size = 0.87 \[ \frac{\sqrt{a+c x^2} \left (-16 a^2 f h-\frac{15 \sqrt{a} \sqrt{c} \sinh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a e h+a f g-4 c d g)}{\sqrt{\frac{c x^2}{a}+1}}+a c (40 d h+5 e (8 g+3 h x)+f x (15 g+8 h x))+2 c^2 x (10 d (3 g+2 h x)+x (5 e (4 g+3 h x)+3 f x (5 g+4 h x)))\right )}{120 c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(g + h*x)*Sqrt[a + c*x^2]*(d + e*x + f*x^2),x]

[Out]

(Sqrt[a + c*x^2]*(-16*a^2*f*h + a*c*(40*d*h + 5*e*(8*g + 3*h*x) + f*x*(15*g + 8*h*x)) + 2*c^2*x*(10*d*(3*g + 2
*h*x) + x*(5*e*(4*g + 3*h*x) + 3*f*x*(5*g + 4*h*x))) - (15*Sqrt[a]*Sqrt[c]*(-4*c*d*g + a*f*g + a*e*h)*ArcSinh[
(Sqrt[c]*x)/Sqrt[a]])/Sqrt[1 + (c*x^2)/a]))/(120*c^2)

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 230, normalized size = 1.3 \begin{align*}{\frac{fh{x}^{2}}{5\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{2\,afh}{15\,{c}^{2}} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{ehx}{4\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{fgx}{4\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}-{\frac{aehx}{8\,c}\sqrt{c{x}^{2}+a}}-{\frac{afgx}{8\,c}\sqrt{c{x}^{2}+a}}-{\frac{{a}^{2}eh}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{{a}^{2}fg}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}+{\frac{dh}{3\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{eg}{3\,c} \left ( c{x}^{2}+a \right ) ^{{\frac{3}{2}}}}+{\frac{dgx}{2}\sqrt{c{x}^{2}+a}}+{\frac{adg}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(f*x^2+e*x+d)*(c*x^2+a)^(1/2),x)

[Out]

1/5*h*f*x^2*(c*x^2+a)^(3/2)/c-2/15*h*f*a/c^2*(c*x^2+a)^(3/2)+1/4*x*(c*x^2+a)^(3/2)/c*e*h+1/4*x*(c*x^2+a)^(3/2)
/c*f*g-1/8*a/c*x*(c*x^2+a)^(1/2)*e*h-1/8*a/c*x*(c*x^2+a)^(1/2)*f*g-1/8*a^2/c^(3/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2
))*e*h-1/8*a^2/c^(3/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))*f*g+1/3*(c*x^2+a)^(3/2)/c*d*h+1/3*(c*x^2+a)^(3/2)/c*e*g+1
/2*d*g*x*(c*x^2+a)^(1/2)+1/2*d*g*a/c^(1/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)*(c*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.4262, size = 770, normalized size = 4.4 \begin{align*} \left [\frac{15 \,{\left (a^{2} e h -{\left (4 \, a c d - a^{2} f\right )} g\right )} \sqrt{c} \log \left (-2 \, c x^{2} + 2 \, \sqrt{c x^{2} + a} \sqrt{c} x - a\right ) + 2 \,{\left (24 \, c^{2} f h x^{4} + 40 \, a c e g + 30 \,{\left (c^{2} f g + c^{2} e h\right )} x^{3} + 8 \,{\left (5 \, c^{2} e g +{\left (5 \, c^{2} d + a c f\right )} h\right )} x^{2} + 8 \,{\left (5 \, a c d - 2 \, a^{2} f\right )} h + 15 \,{\left (a c e h +{\left (4 \, c^{2} d + a c f\right )} g\right )} x\right )} \sqrt{c x^{2} + a}}{240 \, c^{2}}, \frac{15 \,{\left (a^{2} e h -{\left (4 \, a c d - a^{2} f\right )} g\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{-c} x}{\sqrt{c x^{2} + a}}\right ) +{\left (24 \, c^{2} f h x^{4} + 40 \, a c e g + 30 \,{\left (c^{2} f g + c^{2} e h\right )} x^{3} + 8 \,{\left (5 \, c^{2} e g +{\left (5 \, c^{2} d + a c f\right )} h\right )} x^{2} + 8 \,{\left (5 \, a c d - 2 \, a^{2} f\right )} h + 15 \,{\left (a c e h +{\left (4 \, c^{2} d + a c f\right )} g\right )} x\right )} \sqrt{c x^{2} + a}}{120 \, c^{2}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)*(c*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/240*(15*(a^2*e*h - (4*a*c*d - a^2*f)*g)*sqrt(c)*log(-2*c*x^2 + 2*sqrt(c*x^2 + a)*sqrt(c)*x - a) + 2*(24*c^2
*f*h*x^4 + 40*a*c*e*g + 30*(c^2*f*g + c^2*e*h)*x^3 + 8*(5*c^2*e*g + (5*c^2*d + a*c*f)*h)*x^2 + 8*(5*a*c*d - 2*
a^2*f)*h + 15*(a*c*e*h + (4*c^2*d + a*c*f)*g)*x)*sqrt(c*x^2 + a))/c^2, 1/120*(15*(a^2*e*h - (4*a*c*d - a^2*f)*
g)*sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2 + a)) + (24*c^2*f*h*x^4 + 40*a*c*e*g + 30*(c^2*f*g + c^2*e*h)*x^3 + 8
*(5*c^2*e*g + (5*c^2*d + a*c*f)*h)*x^2 + 8*(5*a*c*d - 2*a^2*f)*h + 15*(a*c*e*h + (4*c^2*d + a*c*f)*g)*x)*sqrt(
c*x^2 + a))/c^2]

________________________________________________________________________________________

Sympy [A]  time = 10.0936, size = 384, normalized size = 2.19 \begin{align*} \frac{a^{\frac{3}{2}} e h x}{8 c \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{a^{\frac{3}{2}} f g x}{8 c \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{\sqrt{a} d g x \sqrt{1 + \frac{c x^{2}}{a}}}{2} + \frac{3 \sqrt{a} e h x^{3}}{8 \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{3 \sqrt{a} f g x^{3}}{8 \sqrt{1 + \frac{c x^{2}}{a}}} - \frac{a^{2} e h \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{8 c^{\frac{3}{2}}} - \frac{a^{2} f g \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{8 c^{\frac{3}{2}}} + \frac{a d g \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 \sqrt{c}} + d h \left (\begin{cases} \frac{\sqrt{a} x^{2}}{2} & \text{for}\: c = 0 \\\frac{\left (a + c x^{2}\right )^{\frac{3}{2}}}{3 c} & \text{otherwise} \end{cases}\right ) + e g \left (\begin{cases} \frac{\sqrt{a} x^{2}}{2} & \text{for}\: c = 0 \\\frac{\left (a + c x^{2}\right )^{\frac{3}{2}}}{3 c} & \text{otherwise} \end{cases}\right ) + f h \left (\begin{cases} - \frac{2 a^{2} \sqrt{a + c x^{2}}}{15 c^{2}} + \frac{a x^{2} \sqrt{a + c x^{2}}}{15 c} + \frac{x^{4} \sqrt{a + c x^{2}}}{5} & \text{for}\: c \neq 0 \\\frac{\sqrt{a} x^{4}}{4} & \text{otherwise} \end{cases}\right ) + \frac{c e h x^{5}}{4 \sqrt{a} \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{c f g x^{5}}{4 \sqrt{a} \sqrt{1 + \frac{c x^{2}}{a}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x**2+e*x+d)*(c*x**2+a)**(1/2),x)

[Out]

a**(3/2)*e*h*x/(8*c*sqrt(1 + c*x**2/a)) + a**(3/2)*f*g*x/(8*c*sqrt(1 + c*x**2/a)) + sqrt(a)*d*g*x*sqrt(1 + c*x
**2/a)/2 + 3*sqrt(a)*e*h*x**3/(8*sqrt(1 + c*x**2/a)) + 3*sqrt(a)*f*g*x**3/(8*sqrt(1 + c*x**2/a)) - a**2*e*h*as
inh(sqrt(c)*x/sqrt(a))/(8*c**(3/2)) - a**2*f*g*asinh(sqrt(c)*x/sqrt(a))/(8*c**(3/2)) + a*d*g*asinh(sqrt(c)*x/s
qrt(a))/(2*sqrt(c)) + d*h*Piecewise((sqrt(a)*x**2/2, Eq(c, 0)), ((a + c*x**2)**(3/2)/(3*c), True)) + e*g*Piece
wise((sqrt(a)*x**2/2, Eq(c, 0)), ((a + c*x**2)**(3/2)/(3*c), True)) + f*h*Piecewise((-2*a**2*sqrt(a + c*x**2)/
(15*c**2) + a*x**2*sqrt(a + c*x**2)/(15*c) + x**4*sqrt(a + c*x**2)/5, Ne(c, 0)), (sqrt(a)*x**4/4, True)) + c*e
*h*x**5/(4*sqrt(a)*sqrt(1 + c*x**2/a)) + c*f*g*x**5/(4*sqrt(a)*sqrt(1 + c*x**2/a))

________________________________________________________________________________________

Giac [A]  time = 1.19162, size = 243, normalized size = 1.39 \begin{align*} \frac{1}{120} \, \sqrt{c x^{2} + a}{\left ({\left (2 \,{\left (3 \,{\left (4 \, f h x + \frac{5 \,{\left (c^{3} f g + c^{3} h e\right )}}{c^{3}}\right )} x + \frac{4 \,{\left (5 \, c^{3} d h + a c^{2} f h + 5 \, c^{3} g e\right )}}{c^{3}}\right )} x + \frac{15 \,{\left (4 \, c^{3} d g + a c^{2} f g + a c^{2} h e\right )}}{c^{3}}\right )} x + \frac{8 \,{\left (5 \, a c^{2} d h - 2 \, a^{2} c f h + 5 \, a c^{2} g e\right )}}{c^{3}}\right )} - \frac{{\left (4 \, a c d g - a^{2} f g - a^{2} h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{8 \, c^{\frac{3}{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(f*x^2+e*x+d)*(c*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/120*sqrt(c*x^2 + a)*((2*(3*(4*f*h*x + 5*(c^3*f*g + c^3*h*e)/c^3)*x + 4*(5*c^3*d*h + a*c^2*f*h + 5*c^3*g*e)/c
^3)*x + 15*(4*c^3*d*g + a*c^2*f*g + a*c^2*h*e)/c^3)*x + 8*(5*a*c^2*d*h - 2*a^2*c*f*h + 5*a*c^2*g*e)/c^3) - 1/8
*(4*a*c*d*g - a^2*f*g - a^2*h*e)*log(abs(-sqrt(c)*x + sqrt(c*x^2 + a)))/c^(3/2)